package com.wushijia.designpatterns.command;

/**
 * description:电灯开关命令
 *
 * @author yang
 * @date 2018/1/19 20:25
 */
public class LightCommand implements Command {

  Light light;

  public LightCommand(Light light) {
    this.light = light;
  }

  @Override
  public void execute() {
    light.on();
  }

  @Override
  public void undo() {
    light.off();
  }
}
